package cn.com.ddapp.ddm.util;

import android.os.CountDownTimer;
import android.widget.TextView;

/**
 * Created by Administrator on 2016/6/14 0014.
 */
public class TimeCount extends CountDownTimer {
    private TextView textView;
    public TimeCount(long millisInFuture, long countDownInterval, TextView view) {
        super(millisInFuture, countDownInterval);
        this.textView = view;
    }

    @Override
    public void onFinish() {
        textView.setText("重新获取");
        textView.setClickable(true);
    }

    @Override
    public void onTick(long millisUntilFinished) {
        textView.setClickable(false);
        textView.setText(millisUntilFinished / 1000 + "秒");
    }
}
